void main() {
  forMet();
  print("----");
  mapsMet();
  print("----");
  listMet();
  print("----");
  setMet();
  print("----");
}

void forMet() {
  for (var a = 0; a < 10; a++) {
    if (a == 6) {
      continue;
    }
    print(a);
  }
}

void mapsMet() {
  var maps = {
    "name": "jack",
    "age": 1,
  };
  print(maps);
  print(maps.keys.toList());
  print(maps.values.toList());
  print(maps.isEmpty);
}

void listMet() {
  var list = ['苹果', '香蕉', '菠萝'];
  list.add("葡萄");
  list.remove('苹果');
  list.addAll(['橘子', '草莓']);

  for (var item in list) {
    print(item);
  }
  var a = "v";
  list.forEach((value) {
    print(a + "--" + value);
  });

  var newList = list.map((value) {
    return "value=" + value;
  });
  print(newList.toList());

  var whereList = list.where((value) {
    return value == '橘子' || value == '草莓';
  });
  print(whereList.toList());

  //只要集合里有满足的就会返回true
  var any = list.any((value) {
    return value == '橘子' || value == '草莓';
  });
  print(any);

  //每个都满足就会返回true
  var every = list.every((value) {
    return value == '橘子' || value == '草莓';
  });
  print(every);
}

/**
 * 去重
 */
void setMet() {
  var set = new Set();
  var list = ['a', 'b', 'c', 'a', 'a'];
  set.addAll(list);
  print(set);
}

//闭包
